package com.play.airfight.managers;

import android.content.Context;
import android.graphics.Canvas;

import com.play.airfight.info_panel.GameInfoPanel;

public class GameManager {
    private Context mContext = null;

    private GameStage mCurStage = null;
    private Player mPlayer = null;
    private EnemyManager mEnemyMgr = null;
    private BulletsManager mPlayerBulletsMgr = BulletsManager.getInstance();
    private BulletsManager mEnemyBulletsMgr = new BulletsEnemyManager();
    private ExplodeManager mExplodeMgr = null;
    private GameInfoPanel mGameInfoPanel = null;


    public GameManager(Context mContext) {
        this.mContext = mContext;
        mEnemyMgr = new EnemyManager(mContext);
        mPlayer = Player.getInstance();

    }


    public void drawFrame(Canvas canvas) {
//        mCurStage.drawFrame(canvas);
        mEnemyMgr.drawFrame(canvas);
//        mExplodeMgr.drawFrame(canvas);
        mPlayerBulletsMgr.drawFrame(canvas);
//        mEnemyBulletsMgr.drawFrame(canvas);
        mPlayer.drawFrame(canvas);
//        mGameInfoPanel.drawFrame(canvas);
    }

    public void execLogic() {
//        mCurStage.execLogic();             // 关卡运作子逻辑
        mEnemyMgr.execLogic();             // 所有敌人的运作子逻辑
        mPlayer.execLogic();               // 玩家角色的子逻辑
        mPlayerBulletsMgr.execLogic();     // 玩家发射的子弹的子逻辑
//        mEnemyBulletsMgr.execLogic();      // 敌人发射的子弹的子逻辑
//        mExplodeMgr.execLogic();           // 管理爆炸效果的子逻辑
//        mGameInfoPanel.execLogic();        // 游戏信息面板的子逻辑
//        execCollsionLogic();               // 碰撞子逻辑
    }
}
